﻿using System;
using System.Web.UI;

using Fuse8.ContentManagementFramework.Domain;

namespace Fuse8.ContentManagementFramework.Web.FormPowered
{
    internal static class CmsFormPageControlFactory
    {
        public static Control LoadControl(CmsPageControl pageControl)
        {
            Control result = null;

            switch (pageControl.CommonPageControlType)
            {
                case PageControlTypeKind.Content:
                    result = new CmsFormContentPageControlCreator(pageControl);
                    break;
                case PageControlTypeKind.WebForm:
                    result = new CmsFormAscxPageControlCreator(pageControl);
                    break;
            }

            return result;
        }
    }
}
